
<!DOCTYPE HTML>
<html>
<head>
<title>读取并修改元素的内容</title>
<meta charset="utf-8" />
<style>
	div{float:left; height: 100px; line-height: 100px; }
	#d1,#d3{ background-color: #ccff00; }
	#d2{ cursor: pointer; background-color: #ffcc00; }
	
	::selection{
		background: transparent;
	}
</style>
</head>
<body>
	<div id="d1">树形列表</div>
	<div id="d2"><<</div>
	<div id="d3">内容的主体</div>
	<script type="text/javascript">	
		d2.onclick=function(){		
			d3.style.display=this.innerText=="<<"?"none":"block";
			d2.innerText=d2.innerText=="<<"?">>":"<<";
		}	
	</script>
</body>
</html>
